package com.bins.music.player;

import com.bins.music.player.ui.MusicPlayerUI;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import lombok.extern.slf4j.Slf4j;

import java.util.Objects;

@Slf4j
public class MusicPlayerApp extends Application {

    @Override
    public void start(Stage primaryStage) {
        // 移除默认窗口装饰
        primaryStage.initStyle(StageStyle.UNDECORATED);

        // 创建主界面
        MusicPlayerUI playerUI = new MusicPlayerUI(primaryStage);

        // 创建场景
        Scene scene = new Scene(playerUI, 1200, 800);
        scene.getStylesheets().add(Objects.requireNonNull(getClass().getResource("/css/styles.css")).toExternalForm());

        // 设置舞台
        primaryStage.setTitle("网易云音乐风格播放器");
        primaryStage.setScene(scene);
        primaryStage.getIcons().add(new Image(Objects.requireNonNull(getClass().getResourceAsStream("/images/music-icon.png"))));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}